<template>
	<view class="container product">
		<view class="prod_cover" style="position: relative;">
			<image :src="goods.image|imgfilter" mode="widthFix"></image>
			<image src="/static/img/ysq.png" style="position: absolute;top: 0;left: 0;z-index: 5;" v-if="goods.num==0">
			</image>
			<!-- <u-swiper :list="goods.image" height="750" :autoplay="true" border-radius="0"></u-swiper> -->
		</view>
		<view class="prod_price">
			<view class="pl">
				
				<view class="cp"  v-if="goods.typeid != 37 ">
					￥{{goods.price}}
				</view>
				<view class="cp" style="margin-left: 0rpx;color:#f14b90;" v-show="goods.isykbuy">
					<image src="/static/img/fixed_canExchange_icon.gif" class="td"></image><text
						style="font-size: 20rpx;color:#888">兑换需<span
							style="font-size:40rpx">{{(goods.price/feilv).toFixed(2)}}</span>积分<span
							style="text-decoration:line-through;color: black;">(省￥{{goods.price}})</span></text>
				</view>

				<!-- <view class="op">{{goods.market_price}}</view> -->
			</view>

			<view class="pr">
				<image src="../../static/images/icon_ygm.png" mode="widthFix"></image>
				<!-- <text>已售{{goods.num}}件</text> -->
			</view>


		</view>


		<view class="prod_tit">
			<text v-if="goods.typeid == 37">{{progressTxt}}</text>
			<u-line-progress :percent="percent" striped="true" striped-active="true" activeColor="#ff0000"
				v-if="goods.typeid == 37"></u-line-progress>
			{{goods.name}}
		</view>
		<view class="prod_stit">
			<!-- <text v-if="goods.tudou>0" class="left">赠送土豆：{{goods.tudou}}</text> -->
			<!-- <text v-if="goods.sc_money>0" class="right">赠送活跃度：{{goods.sc_money}}</text> -->
		</view>


		<!-- <view class="prod_shop" @click="gpList">
			<view class="sl">
				<image src="../../static/images/pin-icon.png" mode="aspectFill"></image>
			</view>
			<view class="sc">
				<view class="ct">爱恩倍官方旗舰店</view>
				<view class="cb">日用品</view>
			</view>
			<view class="sr">
				<u-icon name="arrow-right" color="#999" size="28"></u-icon>
			</view>
		</view> -->
		<!-- <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper"
			@scrolltolower="lower" @scroll="scroll" v-if="goods.typeid == '39'"> -->
		<view v-if="goods.typeid == '39' && list.length>0"
			style="display: flex;flex-direction: column; padding: 10rpx 40rpx;margin:10rpx 0;background-color: #fff;">

			<view
				style="display: flex;justify-content: space-between;align-items: center;height: 80rpx;line-height: 80rpx;">
				<view style="width: 70%;">这些人刚拼单成功,可参与拼单</view>
				<view @click="toseeall">查看全部<u-icon name="arrow-right" color="#909399" size="28"></u-icon>
				</view>
			</view>
			<view class="scroll_box" style="height: 100rpx;">
			<swiper class="swiper" circular="false"  :autoplay="autoplay" disable-touch="true" :interval="interval"
						:duration="duration" vertical="true" next-margin="1px">
						<swiper-item v-for="(item,index) in list" :key="index" style="border-bottom: 1px solid #999;padding: 10rpx 0;">
							<view
														style="display: flex;justify-content: space-around;height: 40rpx;justify-content: space-between;">
														<view class="swiper-item uni-bg-green" style="width: 60%;">
															<view class="swiper-item uni-bg-green"
																style="display: flex;flex-wrap: nowrap;align-items: center;margin-top: 20rpx;padding-left: 10rpx;">
																<view v-for="(item2,index2) in item.content"
																	style="display: flex;flex-wrap: nowrap;margin-left: -15rpx;">
																	<image :src="item2.img"
																		style="width: 50rpx; height: 50rpx;border-radius: 50rpx;"></image>
																	<!-- <view>{{item2.phone}}</view> -->
																</view>
																<u-count-down :timestamp="item.time" style="margin-left: 50rpx;"></u-count-down>
															</view>
														</view>
														<view style="margin-top: 28rpx;font-size: 25rpx;">还差{{ptsum-item.content.length}}人</view>
														<view
															style="background-color: red;padding: 10rpx 30rpx;line-height: 40rpx;border-radius: 20rpx;color: #fff;height: 60rpx;margin-top: 10rpx;"
															@click="gopingt(item.id)">去拼团</view>
													</view>
							
						</swiper-item>
					
					</swiper>

			</view>
		</view>

		<view class="prod_tips" style="position: relative;z-index: 9999;color: #f14b90;">
			温馨提示：受疫情影响，实物商品在部分疫情地区可能存在延迟发货，非实物商品不受影响，如给您带来不便敬请谅解。
		</view>
		<view class="prod_tit1" style="position: relative;z-index: 9999; margin-top:-20rpx ;">
			— 商品详情 —
		</view>
		<view class="prod_desc" style="">
			<rich-text :nodes="goods.desc"></rich-text>
			<!-- <image :src="product.desc" mode="widthFix"></image> -->
		</view>
		<view class="submitbar" style="z-index: 999999;">
			<view class="left">
				<view class="item" @click="goindex">
					<u-icon name="home" :size="40" :color="$u.color['contentColor']"></u-icon>
					<view class="text u-line-1">首页</view>
				</view>
			
				<view class="item car" @click="goToCart" >
					<!-- <u-badge class="car-num" :count="9" type="error" :offset="[-3, -6]"></u-badge> -->
					<u-icon name="shopping-cart" :size="40" :color="$u.color['contentColor']"></u-icon>
					<view class="text">购物车</view>
				</view>
				<view class="item" @click="collectionClick">
					<u-icon name="star" :size="40" :color="$u.color['contentColor']"></u-icon>
					<view class="text u-line-1">客服</view>
				</view>
			</view>
			<view class="right" v-if="goods.num>0">
				<view class="cart btn u-line-1" @click="addCart" v-if="goods.typeid != '38' && goods.typeid != '39' ">
					加入购物车</view>
				<view class="cart btn u-line-1" @click="addPt" v-if="goods.typeid == '39'">发起拼团</view>
				<view class="buy btn u-line-1" style="background-color:#f14b90;" @click="goConfirm" v-if=" goods.typeid != '39'">
					<!-- <text v-if="isshow">积分兑换</text> -->
					<text>立即购买</text>
				</view>
				
				<!-- <view class="buy btn u-line-1" v-if="isclick<=0">
					<text>购买数量不能为0</text>
				</view> -->
			</view>
			<view v-if="goods.num<0"
				style="background-color: #f14b90;padding: 10rpx;border-radius: 10rpx;margin-left: 50rpx;line-height: 50rpx;width: 300rpx;text-align: center;color:#fff;">
				未发售</view>
			<view v-if="goods.num==0"
				style="background-color: #f14b90;padding: 10rpx;border-radius: 10rpx;margin-left: 50rpx;line-height: 50rpx;width: 300rpx;text-align: center;color:#fff;">
				已售罄</view>
		</view>
		<u-popup v-model="specPopShow" mode="bottom" height="800" border-radius="30" :closeable="true"
			:safe-area-inset-bottom="true">
			<view class="specPopup">
				<view class="ptop">
					<view class="tl">
						<image :src="goods.image" mode="aspectFill"></image>

					</view>
					<!-- <view class="tc">
						<view class="cp">
							￥
							<text>{{product.sales_price}}</text>
						</view>
						<view class="cb">已领{{product.soldOut}}件</view>
					</view> -->
				</view>



				<scroll-view class="pcenter" scroll-y="true">
					<!-- <view class="pbox">
						<view class="bt">重量</view>
						<view class="bc">
							<view class="citem">80g</view>
						</view>
					</view>
					<view class="pbox">
						<view class="bt">种类</view>
						<view class="bc">
							<view class="citem">5块</view>
						</view>
					</view> -->
					<view class="numbox">
						<view class="bl">数量</view>
						<view class="br" v-if="typeid==38 || typeid==40">
							<u-number-box v-model="numValue" @change="valChange" :min="1" ></u-number-box>
						</view>
						<view class="br" v-else>
							<u-number-box v-model="numValue"  @change="valChange" :min="1"></u-number-box>
						</view>
					</view>
				</scroll-view>
				<view class="pbottom">
					<button class="pbtn" @click="specPopShow = false">确认</button>
				</view>
			</view>
		</u-popup>
		
		<view>
			<u-popup v-model="pingtflag" mode="center" width="700rpx" height="600rpx" ref="pops" :closeable="true">
								
				<view style="position: relative;width: 100%; height: 100%;display: flex;flex-direction: column;background-color: #fff;margin-top: 80rpx;padding: 0 20rpx 0 40rpx;">
					<view v-for="(item,index) in list" :key="index"
											style="padding: 10rpx 0;height: 100rpx;">
											<view
												style="display: flex;justify-content: space-around;height: 40rpx;justify-content: space-between;">
												<view class="swiper-item uni-bg-green" style="width: 60%;">
													<view class="swiper-item uni-bg-green"
														style="display: flex;flex-wrap: nowrap;align-items: center;margin-top: 20rpx;">
														<view v-for="(item2,index2) in item.content"
															style="display: flex;flex-wrap: nowrap;margin-left: -20rpx;">
															<image :src="item2.img"
																style="width: 50rpx; height: 50rpx;border-radius: 50rpx;"></image>
															
														</view>
														<u-count-down :timestamp="item.time" style="margin-left: 50rpx;"></u-count-down>
													</view>
												</view>
												<view style="margin-top: 28rpx;font-size: 25rpx;">还差{{ptsum-item.content.length}}人</view>
												<view
													style="background-color: red;padding: 10rpx 30rpx;line-height: 40rpx;border-radius: 20rpx;color: #fff;height: 60rpx;margin-top: 10rpx;"
													@click="gopingt(item.id)">去拼团</view>
											</view>
					
										</view>
				</view>
			</u-popup>
		</view>
		<view>
			<u-popup v-model="show8" border-radius="25" mode="center" width="690rpx"  ref="pops">
			
				<view style="position: relative;width: 100%; height: 100%;display: flex;flex-direction: column;background-color: #fff;">
					 <u-icon name="close-circle" color="#fff" size="52" style="z-index: 6;position: absolute;right: 20rpx;top:15rpx" @click="closep"></u-icon>
					<view style="width: 100%; height: 90rpx;background-color: #f14b90;color: #fff;text-align: center;line-height: 90rpx;">提示信息</view>
					<!-- <view style="height: 5%;padding: 10rpx 40rpx;">您目前积分可购{{isclick}}件爆款产品</view> -->
					<view style="height: 20%;padding: 10rpx 40rpx;">需要借公司积分<text style="color:#f14b90;font-weight: 600;">{{jifeng.toFixed(2)}}</text>个方可购买该产品</view>
					<view style="height: 20%;padding: 10rpx 20rpx;">
						<u-checkbox-group>
							<u-checkbox v-model="checked" style="font-size:15rpx;">
								已阅读并同意积分借款协议<text @click="toArticles(53,'积分借款合同')"
									style="color: #f14b90;">《积分借款合同》</text>
							</u-checkbox>
						</u-checkbox-group>
					</view>
					
					<view style="display: flex;margin: 40rpx 0;">
						<view style="width: 40%; height: 70rpx;background-color: #f14b90;color: #fff;text-align: center;line-height: 70rpx;margin: 0 auto;border-radius: 25rpx;" @click="closep">取消</view>
						<view style="width: 40%; height: 70rpx;background-color: #f14b90;color: #fff;text-align: center;line-height: 70rpx;margin: 0 auto;border-radius: 25rpx;" @click="show8acc">同意</view>
					</view>
				</view>
			</u-popup>
		</view>
	</view>
</template>

<script>
	import service from '../../service.js';
	import baseScrollList from '../../components/baseScrollList.vue'
	export default {
		
		data() {
			return {
				yhactive:"银行卡支付满1000送100元优惠卷",
				yhjlist:[],
				pingtflag:false,
				pheight:600,
				checked:false,
				autoplay: false,
				interval: 2000, //前后两张轮播间隔时间
				duration: 500, //切换一张图所需时间
				timestamp: 86400, //倒计时
				// list: [{
				// 		id: 1,
				// 		content: [{
				// 			img: '/static/img/pt.jpg',
				// 			phone: '152****2595'
				// 		}, {
				// 			img: '/static/img/pt2.jpg',
				// 			phone: '158****2972'
				// 		}],
				// 		time: 86400
				// 	},
				// 	{
				// 		id: 2,
				// 		content: [{
				// 			img: '/static/img/pt2.jpg',
				// 			phone: '157****7998'
				// 		}, {
				// 			img: '/static/img/pt.jpg',
				// 			phone: '136****2994'
				// 		}],
				// 		time: 76400
				// 	},
				// 	{
				// 		id: 3,
				// 		content: [{
				// 			img: '/static/img/pt1.jpg',
				// 			phone: '152****2595'
				// 		}, {
				// 			img: '/static/img/pt2.jpg',
				// 			phone: '158****2972'
				// 		},{
				// 			img: '/static/img/pt3.jpg',
				// 			phone: '152****2595'
				// 		}, {
				// 			img: '/static/img/pt4.jpg',
				// 			phone: '158****2972'
				// 		},{
				// 			img: '/static/img/pt5.jpg',
				// 			phone: '152****2595'
				// 		}, {
				// 			img: '/static/img/pt6.jpg',
				// 			phone: '158****2972'
				// 		},{
				// 			img: '/static/img/pt7.jpg',
				// 			phone: '158****2972'
				// 		}],
				// 		time: 66400
				// 	},
				// 	{
				// 		id: 4,
				// 		content: [{
				// 			img: '/static/img/pt2.jpg',
				// 			phone: '157****7998'
				// 		}, {
				// 			img: '/static/img/pt.jpg',
				// 			phone: '136****2994'
				// 		}],
				// 		time: 96400
				// 	},
					
				// ],
				list:[],
				goods: {},
				percent: 0,
				progressTxt: '',
				userInfo: {},
				isclick: 1,
				product: {
					id: 0,
					cover: [
						'/static/img/product1.jpg',
						'/static/img/product1.jpg',
					],
					title: "爱恩倍 内衣专用皂80g*5袋",
					subtitle: '爱恩倍 内衣专用皂80g',
					sales_price: 40,
					market_price: 68,
					spec: '80g x5块 x1',
					city: '北京',
					freight: '包邮',
					soldOut: 500,
					stock: 10000,
					desc: '/static/img/detail.jpg'
				},
				specPopShow: false,
				numValue: 1,
				isshow: 1,
				feilv: '',
				typeid: '',
				istz: 0,
				ptsum:0,
				jifeng:0,
				show8:false
			};
		},
		components: {
			baseScrollList
		},
		computed: {

		},
		onShareAppMessage(e) {
			return {
				title: this.product.title,
			};
		},
		filters: {
					// 格式化物流信息
					pricefilter(str) {
						// var str=str+'66';
						var n=str.split(".");
						console.log(n)
						var pp="";
						if(n[1]!='00'){
							var p=n[1];
							pp=p.substr(0,1)
							return n[0]+"."+pp;
						}else{
							return n[0];
						}
					},
					imgfilter(str) {
						return str.replace("https","http")
					},
				},
		async onLoad(options) {
			//接收传值,id里面放的是标题，因为测试数据并没写id 
			let id = options.id;

			if (id) {

				this.product = id;
				var result = (await this.$ajax.get('Product/get.html?id=' + id));
				//console.log(result);

				this.goods = result.data.data
				console.log(this.goods);
				this.isshow = result.data.data.isshow
				this.feilv = result.data.data.feilv
				this.typeid = result.data.data.typeid
				//	this.$api.msg(`点击了${id}`);
			}

			console.log(this.goods);
			var result = (await this.$ajax.get('users/getUserInfo.html'));
			var result22 = (await this.$ajax.get('users/test66.html?id='+id));
			console.log(result22);
			this.userInfo = result.data.data;
			if (this.typeid == '38') {
				// var num = Math.floor((this.userInfo.yk_static) / (this.goods.price*0.05) );
				this.isclick = result22.data.data;
				// this.show8 = true;
				// this.$api.msg("您的积分只能购" + this.isclick + "件！")

			}

			// if (this.goods.typeid == 37) {

			// 	var num = this.userInfo.js_static / this.goods.price * 10000;
			// 	this.percent = Math.round(num, 2) / 100;
			// 	if (this.percent > 100) this.percent = 100;
			// 	var synum = Math.round((this.goods.price - this.userInfo.js_static) * 100, 2) / 100;
			// 	this.progressTxt = (this.percent < 100) ? "离免费兑换仅差" + synum + "积分" : "恭喜你免费获得该产品";
			// }


			// if(id == 40 || id == 35 || id == 39) {
			// 	var result = (await this.$ajax.get('websiteconfig/index.html?id=' + id));

			// 	if(result.data.data.saleout != 1) {
			// 		uni.showModal({
			// 			 title: '更新提示',
			// 			 content: "当前商品已达峰值",
			// 			 success: (showResult) => {
			// 				 if (showResult.confirm) {
			// 					 uni.navigateBack()
			// 				 } else {
			// 					 uni.navigateBack()
			// 				 }
			// 			 }
			// 		})
			// 		return;
			// 	}
			// }

			// if(this.product.onsale == -1) {
			// 	uni.showModal({
			// 		 title: '更新提示',
			// 		 content: "当前商品暂未开放",
			// 		 success: (showResult) => {
			// 			 if (showResult.confirm) {
			// 				 uni.navigateBack()
			// 			 } else {
			// 				 uni.navigateBack()
			// 			 }
			// 		 }
			// 	})
			// 	return;
			// }


			// var result = (await this.$ajax.get('users/getUserInfo.html'));
			// this.userinfo = result.data.data

			// if(options.id == 41) {
			// 	if(this.userinfo.level == 2) {

			// 	} else {
			// 		uni.showModal({
			// 			 title: '更新提示',
			// 			 content: "您的等级无法购买当前商品",
			// 			 success: (showResult) => {
			// 				 if (showResult.confirm) {
			// 					 uni.navigateBack()
			// 				 } else {
			// 					 uni.navigateBack()
			// 				 }
			// 			 }
			// 		})
			// 		return;
			// 	}
			// }

			// if(options.id == 42) {
			// 	if(this.userinfo.level == 3) {

			// 	} else {
			// 		uni.showModal({
			// 			 title: '更新提示',
			// 			 content: "您的等级无法购买当前商品",
			// 			 success: (showResult) => {
			// 				 if (showResult.confirm) {
			// 					 uni.navigateBack()
			// 				 } else {
			// 					 uni.navigateBack()
			// 				 }
			// 			 }
			// 		})
			// 		return;
			// 	}
			// }


			// if(options.id == 43) {
			// 	if(this.userinfo.level == 4) {

			// 	} else {
			// 		uni.showModal({
			// 			 title: '更新提示',
			// 			 content: "您的等级无法购买当前商品",
			// 			 success: (showResult) => {
			// 				 if (showResult.confirm) {
			// 					 uni.navigateBack()
			// 				 } else {
			// 					 uni.navigateBack()
			// 				 }
			// 			 }
			// 		})
			// 		return;
			// 	}
			// }

			// var result = (await this.$ajax.get('Product/checkBuy.html?id=' + id));

			// if(result.data.code == 1) {

			// } else {
			// 	uni.showModal({
			// 		 title: '更新提示',
			// 		 content: "当前商品您只能购买一次",
			// 		 success: (showResult) => {
			// 			 if (showResult.confirm) {
			// 				 uni.navigateBack()
			// 			 } else {
			// 				 uni.navigateBack()
			// 			 }
			// 		 }
			// 	})
			// 	return;
			// }
			this.getcoupons();
		},
		async onShow() {
			


		},
		methods: {
			
			toArticles(aid, title) {
				console.log(this.jifeng+"5555555555555")
				this.userInfo.jifeng=(this.goods.price*this.numValue*0.05-this.userInfo.yk_keyong).toFixed(2);
				var str= JSON.stringify(this.userInfo);
				uni.navigateTo({
					url: "/pages/public/articles?aid=" + aid + '&title=' + title+'&str='+str
				});
			},
			//获取优惠卷
			async getcoupons(){
				var result= await this.$ajax.get('coupons/sendcoupons?price=' +this.goods.price);
				console.log(result.data.data+"CCCCCC")
				if(result.data.data.length>0){
					this.yhjlist=result.data.data;
				}
				this.yhactive=this.yhjlist[0];
			},
			
			toseeall(){
				this.pingtflag=true;
			},
			// 产生不重复的随机数
			produceNum() {
				let arr = [];
				for (let i = 0; i < arr.length; i++) {
					let num = Math.floor((Math.random() * (max - min)) + min);
					if (arr.indexOf(num) == -1) { //不存在推入
						arr.push(num);
					} else {
						i--; //存在了使i-1增加一次循环次数
					}
				}
				return arr;
			},
			goToCart() {
				//console.log("wwwwwwwwwwwww");

				uni.switchTab({
					url: '/pages/tabBar/cart/cart'
				})
			},
			// 参与拼团
			async gopingt(ptid) {
				if (service.isLogin() == false) {
					uni.navigateTo({
						url: "/pages/public/login"
					})
				} else {

					if (this.userInfo.yk_static < 10) {
						this.$api.msg("积分不足10个,不能拼团!");
						return false;
					}
					var result2 = await this.$ajax.get('Cart/checkpt?id=' + ptid);
					if (result2.data.code == -1) {
						this.$api.msg(result2.data.msg);
						return false;
					}
					var result = (await this.$ajax.get('Cart/directBuy?id=' + this.product + "&num=" + this.numValue));
					uni.navigateTo({
						url: '/pages/cart/confirm?ptid=' + ptid + '&pt=2'
					})
				}
			},
			//发起拼团
			async addPt() {
				if (service.isLogin() == false) {
					uni.navigateTo({
						url: "/pages/public/login"
					})
				} else {


					//拉起支付
					if (this.userInfo.yk_static < 10) {
						this.$api.msg("积分不足10个,不能拼团!");
						return false;
					}
					if (this.istz == 1) {
						this.$api.msg("不能重复发起拼团");
						return false;
					}

					var result = (await this.$ajax.get('Cart/directBuy?id=' + this.product + "&num=" + this.numValue));
					uni.navigateTo({
						url: '/pages/cart/confirm?pt=1'
					})
				}
				//加入拼团表
				//var reslut=await this.$ajax.get('Cart/fqpingt?id=' + this.product)
			},
			//获取商品正在进行的拼团
			async getpingt() {
				var result = (await this.$ajax.get('Cart/getpingt?id=' + this.product));


			},
			goindex() {
				// uni.navigateTo({
				// 	url:'/pages/index/index'
				// })
				uni.switchTab({
					url: '/pages/tabBar/home/home'
				});
			},

			valChange(e) {
				console.log('当前值为: ' + e.value)
				if (this.typeid == '38' && this.goods.price>100){
					var num = Math.floor((this.userInfo.yk_static) / 50 );
					console.log(Math.floor((this.userInfo.yk_static) / 50) + "????>>>>")
					if (e.value > num ) {
						this.$api.msg("积分不足！")
						this.isclick = num
					}
				}
				
			},

			gpList() {
				uni.navigateTo({
					url: '/pages/product/list'
				})
			},

			async addCart() {
				if (service.isLogin() == false) {
					uni.navigateTo({
						url: "/pages/login/login"
					})
				} else {
					
					var result = (await this.$ajax.get('Cart/add?id=' + this.product + "&num=" + this.numValue));
					this.$api.msg(result.data.msg);
				}
			},
			closep(){
				this.show8=false
			},
			async show8acc(){
				if (!this.checked) {
					this.$tip.toast('请先同意积分借款合同');
					return false
			  }
			 this.jifeng  =this.goods.price*this.numValue*0.05-this.userInfo.yk_keyong;
			 var result=await this.$ajax.get('Users/test55?num='+this.jifeng) 
			 if(result.data.code==1){
				 this.$api.msg(result.data.msg);
				 var result33 = (await this.$ajax.get('users/getUserInfo.html'));
				 this.userInfo=result33.data.data
				 this.show8=false
			 }
				this.show8=false
			},
			async goConfirm() {
				if (service.isLogin() == false) {
					uni.navigateTo({
						url: "/pages/public/login"
					})
				} else {
					console.log('confirm');
					//console.log(1111);
					// var num = Math.floor((this.userInfo.yk_keyong) / (this.goods.price*0.05)) ;

					// if (this.typeid == '38') {
					// 	this.jifeng=this.goods.price*this.numValue*0.05-this.userInfo.yk_keyong ;
					// 	console.log(this.jifeng+"MMMMMMm");
					// 	if(this.jifeng>0){
					// 		this.show8=true;
					// 		return false;
					// 	}
					// 	// if (Number(this.numValue) > num) {
					// 	// 	this.$api.msg("您的积分只能购" + num + "件！")
					// 	// 	this.numValue = num;
					// 	// 	return false;
					// 	// }
					// }
					// var result = (await this.$ajax.get('Cart/directBuy?id=' + this.product + "&num=" + this.numValue));

					// uni.navigateTo({
					// 	url: '/pages/cart/confirm'
					// })
					console.log(this.goods);
					let tmpList=[];
					tmpList[0] = {
						good_id: this.goods.id,
						id: this.goods.id,
						image: this.goods.image,
						isykbuy: false,
						num: 1,
						number: 1,
						price: this.goods.price,
						selected: true,
						sku_id: this.goods.id,
						title: this.goods.name,
						typeid: this.goods.typeid,
						user_id: this.goods.user_id,
						ykprice: this.goods.ykprice,
					};
					uni.setStorage({
						key:'buylist',
						data:tmpList,
						success: () => {
							uni.navigateTo({
								url:'/pages/order/confirmation'
							})
						},
						fail(res) {
							console.log(res);
						}
					})
				}
			},
			goAddress() {
				uni.navigateTo({
					url: '/pages/address/addSite'
				})
			},
			collectionClick() {
				// console.log(service.isLogin());
				// return;
				if (service.isLogin() == false) {
					uni.navigateTo({
						url: "/pages/login/login"
					})
				}
			
				// console.log(url);
				// #ifdef APP-PLUS
				plus.runtime.openURL(https://work.weixin.qq.com/kfid/kfccc640bd85543e2fa);
				// #endif
			
			},

			shoppingCart() {
				if (service.isLogin() == false) {
					uni.navigateTo({
						url: "/pages/public/login"
					})
				}
			}
		},
	}
</script>

<style lang="scss">
	page {
		background: #f6f6f6;
		-webkit-user-select: text;
	}
	/deep/.submitbar .left .item[data-v-5566b618]{
		margin: 0 5rpx;
	}
	.product {}

	.scroll-Y {
		height: 360rpx;
	}

	.scroll-view_H {
		white-space: nowrap;
		width: 100%;
	}

	.scroll-view-item {
		height: 300rpx;
		line-height: 300rpx;
		text-align: center;
		font-size: 36rpx;
	}

	.scroll-view-item_H {
		display: inline-block;
		width: 100%;
		height: 300rpx;
		line-height: 300rpx;
		text-align: center;
		font-size: 36rpx;
	}

	.prod_cover {
		height: auto;
		overflow: hidden;
		background: #fff;
		width: 750rpx;
		height: 750rpx;

		image {
			width: 750rpx;
			height: 750rpx;
		}
	}

	.prod_price {
		height: auto;
		overflow: hidden;
		background: #fff;
		padding: 10rpx 20rpx;
		display: flex;
		// justify-content:space-between;
		justify-content: space-around;
		align-items: center;

		.pl {
			display: flex;
			justify-content: flex-start;
			align-items: center;

			image {
				width: 40rpx;
			}

			.cp {
				font-size: 40rpx;
				color: #f14b90;
				margin: 0 20rpx 0 10rpx;

				image {
					position: relative;
					bottom: -5rpx;
					width: 38rpx;
					height: 38rpx;
					margin-right: 5rpx;
				}
			}

			.op {
				font-size: 26rpx;
				color: #999;
				text-decoration: line-through;
			}
		}

		.pr {
			display: flex;
			justify-content: flex-end;
			align-items: center;

			image {
				width: 28rpx;
				margin-right: 10rpx;
			}

			text {
				font-size: 24rpx;
				color: #999;
			}
		}
	}

	.prod_tit {
		height: auto;
		overflow: hidden;
		background: #fff;
		padding: 10rpx 30rpx;
		font-size: 36rpx;
		color: #333;
		line-height: 1.5;
		text-align: left;

		text {
			font-size: 28rpx;
		}
	}

	.prod_stit {
		display: flex;
		height: auto;
		overflow: hidden;
		background: #fff;
		padding: 10rpx 30rpx 30rpx 30rpx;
		font-size: 26rpx;
		color: #666;
		line-height: 1.2;
		text-align: left;

		.left {
			flex: 1;
		}

		.right {
			flex: 1;
			text-align: right;
		}
	}

	/deep/ .u-cell-box {
		margin: 20rpx 0 0 0;
	}

	.prod_shop {
		height: auto;
		overflow: hidden;
		background: #fff;
		padding: 20rpx 30rpx;
		text-align: left;
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-top: 20rpx;

		.sl {
			margin-right: 20rpx;

			image {
				width: 70rpx;
				height: 70rpx;
				border-radius: 100rpx;
				margin-top: 5rpx;
			}
		}

		.sc {
			flex: 1;

			.ct {
				font-size: 30rpx;
				color: #333;
				margin-bottom: 5rpx;
			}

			.cb {
				font-size: 24rpx;
				color: #999;
			}
		}

		.sr {}
	}

	.cell-value {
		text-align: left;
		padding-left: 40rpx;
		font-size: 28rpx;
		color: #333;
	}

	.prod_tips {
		height: auto;
		overflow: hidden;
		background: #fff;
		padding: 30rpx 50rpx;
		text-align: left;
		font-size: 24rpx;
		line-height: 1.6;
		color: #FA3534;
	}

	.prod_tit1 {
		height: auto;
		overflow: hidden;
		background: #fff;
		padding: 40rpx 30rpx;
		font-size: 36rpx;
		color: #333;
		line-height: 1.5;
		text-align: center;
		margin-top: 20rpx;
	}

	.prod_desc {
		height: auto;
		overflow: hidden;
		background: #fff;
		padding-bottom: 120rpx;

		image {
			width: 100%;
			display: block;
		}
	}

	.submitbar {
		width: 100%;
		height: auto;
		overflow: hidden;
		position: fixed;
		bottom: 0;
		left: 0;
		z-index: 100;
		display: flex;
		border-top: solid 2rpx #f2f2f2;
		background-color: #ffffff;
		padding: 16rpx 0;

		.left {
			width: 40%;
			display: flex;
			font-size: 20rpx;

			.item {
				flex: 1;
				text-align: center;
				margin: 0 20rpx;

				&.car {
					text-align: center;
					position: relative;

					.car-num {
						position: absolute;
						top: -10rpx;
						right: -10rpx;
					}
				}
			}
		}

		.right {
			flex: 1;
			display: flex;
			font-size: 28rpx;
			align-items: center;
			padding: 0 20rpx;

			.btn {
				line-height: 66rpx;
				padding: 0;
				text-align: center;
				border-radius: 36rpx;
				color: #ffffff;
			}

			.cart {
				flex: 1;
				background-color: #ed3f14;
				margin-right: 20rpx;
			}

			.buy {
				flex: 1;
				background-color: #ff7900;

			}
		}
	}

	.specPopup {
		height: 100%;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: space-between;

		.ptop {
			width: 100%;
			height: auto;
			overflow: hidden;
			padding: 30rpx 30rpx 20rpx 30rpx;
			display: flex;
			justify-content: flex-start;
			align-items: center;

			.tl {
				margin-right: 30rpx;

				image {
					width: 140rpx;
					height: 140rpx;
				}
			}

			.tc {
				flex: 1;

				.cp {
					display: flex;
					justify-content: flex-start;
					align-items: center;
					margin-bottom: 10rpx;

					image {
						width: 40rpx;
					}

					text {
						font-size: 40rpx;
						color: #dd121b;
						margin: 0 0rpx 0 10rpx;
					}
				}

				.cb {
					font-size: 24rpx;
					color: #999;
				}
			}
		}

		.pcenter {
			height: 500rpx;
		}

		.pbox {
			height: auto;
			overflow: hidden;
			padding: 10rpx 30rpx;

			.bt {
				font-size: 30rpx;
				color: #333;
				margin: 10rpx 0;
			}

			.bc {
				height: auto;
				overflow: hidden;
				padding: 10rpx 0;

				.citem {
					height: 70rpx;
					line-height: 70rpx;
					padding: 0 40rpx;
					border-radius: 10rpx;
					float: left;
					background: rgba($color: #ff0d04, $alpha:0.1);
					font-size: 26rpx;
					color: #ff0d04;
				}
			}
		}

		.numbox {
			height: auto;
			overflow: hidden;
			padding: 20rpx 30rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.bl {
				font-size: 30rpx;
				color: #333;
			}

			.br {}
		}

		.pbottom {
			width: 100%;
			padding: 20rpx 30rpx;

			button {
				width: 100%;
				height: 80rpx;
				line-height: 80rpx;
				border-radius: 100rpx;
				font-size: 30rpx;
				color: #fff;
				background: -webkit-linear-gradient(left, #ff5f34, #ee0b24);

				&::after {
					display: none;
				}
			}
		}
	}
</style>
